/*****************************************************************************/
/* File: Ball.h						                                         */
/* Author: rszulgo                                                           */
/*                                                                           */
/* Description:																 */
/* Representation of ball object.											 */
/*****************************************************************************/
#pragma once

#include "Drawable.h"
#include "Bat.h"
#include "Level.h"
#include "Common.h"

class CBall : public CDrawable
{
public:
	CBall(CPhysics* pPhysics);
	~CBall(void);

	int Draw();
	int Update();

	float GetSpeed(){return m_fSpeed;}

	int BatBounce(CBat* pBat);	// called when ball hits the bat and have to bounce
	int Out(CBat* pBat);		// ball out on the owner of pBat side


	void SetRecent(CBat* pBat) { m_pBatRecent = pBat; }
	CBat* GetRecent() { return m_pBatRecent; }

	void SetSurface(GLfloat fSurface[4]) { for(int i=0; i<4; i++) m_fBallSurface[i] = fSurface[i]; }

	int GetType(){return TYPE_BALL;}

private:
	float m_fSpeed;	
	CBat* m_pBatRecent;			//poiter to bat that was touched recently
	GLfloat m_fBallSurface[4];	//surface
	bool m_bTrapped;			//true if ball is "trapped" by player. pointer to player set in BatRecent
//	float m_fXTrapOffset;	

};
